/*
Author:kermit
Email:455196886@qq.com
Company:http://dragontrail.com/
Creattime:2017-1-08
*/

//依赖jquery
var Destination = function() {
	var  destination = this;
	destination.Init = function() {
		//滚动加载
		App.ScrollLoadMoreInit('.destination-list', 'destination', function(data){
			console.log('data',data);
			var desHtml = '',
				desData = data.destinations;
			for(i in desData){
				var item = desData[i],
					thumbnail = item.thumbnail ? item.thumbnail : '/webs/hurtigruten/assets/images/example/fleet_line_img.jpg',
					item_tpl = '<li class="item">'+
									'<a href="/destination/'+item.post_name+'" class="item-img img-link"><img src="'+thumbnail+'" alt=""></a>'+
									'<div class="text-area">'+
										'<div class="text-area-inner">'+
											'<h3 class="title">'+item.title+'</h3>'+
											'<div class="describe">'+item.excerpt+'</div>'+
											'<p class="text-red tags">'+item.keywords+'</p>'+
											'<p class="text-right link-box"><a href="/destination/'+item.post_name+'" class="btn-icon-o"><i class="fa fa-angle-right"></i></a></p>'+
										'</div>'+
									'</div>'+
								'</li>';
				desHtml += item_tpl;
			}
			$('.destination-list').append(desHtml);
		});
	}
}
var Destination = new Destination();
Destination.Init();